package com.jia.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 1038940655
 * @create 2021/1/19 19:48
 */

@Configuration
public class ApplicationContextConfig {

    @Bean
//配置ribbon负载均衡来实现RestTemplate
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
